package ru.edu.vstu.atpp.acm.ui.services.dao.impl;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;
import ru.edu.vstu.atpp.acm.ui.entities.Groups;
import ru.edu.vstu.atpp.acm.ui.services.dao.GroupsDAO;

import java.util.List;

public class GroupsDAOImpl implements GroupsDAO {

    @Inject
    private Session session;

    @Override
    public List<Groups> getAll() {
        return session.createCriteria(Groups.class).list();
    }

    @Override
    public Groups getById(Long id) {
        return (Groups) session.get(Groups.class, id);
    }
}
